import { useUpgraderInternal } from './data';
import { UpgraderOptions } from './types';

/** 使用升级程序
 * @param options 升级程序选项
 * @param selector 选择器
 */
export function useUpgrader(options?: UpgraderOptions, selector: string = '') {
  /** 升级程序-内部 */
  const upgrader = useUpgraderInternal(selector);

  if (options) {
    upgrader.setOptions(options);
  }

  return upgrader;
}
